<?php
class Solicitudes_Form_DocentesAutoevalucion extends Form_Cna {
	protected $NivelesAcademicos;
	protected $AreasConocimiento;

    public function __construct($options = null) {
        parent::__construct($options);
    }

    public function init() {
        $ServiceAreas = new Generales_Model_Areas();
        $this->AreasConocimiento = $ServiceAreas->getarrayAreas(-3);
        
        $ServiceNiveles = new Generales_Model_Niveles();
        $this->NivelesAcademicos = $ServiceNiveles->getarrayNiveles();
    	
        $domConfig = Zend_Registry::get('domConfig'); //esto se crea en el bootstrap
        $this->setName('instalaciones');
        $this->setMethod("post");
        $this->setAttrib('enctype', 'multipart/form-data');
        
        $array_elements[] = new Zend_Form_Element_Hidden("coddocentevisita");
        $array_elements[] = new Zend_Form_Element_Hidden("tipodocente");

        $element = new Zend_Form_Element_Text("nombres");
	    $element->setLabel("Nombres : ");
	    $element->setRequired(true);
	    $element->addFilter('StripTags');
	    $element->addFilter('StringTrim');
//	    $element->addFilter('StringToUpper');
	    $element->setAttribs(array('size'=>50));
	    $array_elements[] = $element;
	    
        $element = new Zend_Form_Element_Text("apellidos");
	    $element->setLabel("Apellidos : ");
	    $element->setRequired(true);
	    $element->addFilter('StripTags');
	    $element->addFilter('StringTrim');
//	    $element->addFilter('StringToUpper');
	    $element->setAttribs(array('size'=>50));
	    $array_elements[] = $element;
        
		$element = new Zend_Form_Element_Text ( 'identificacion' );
		$element->setLabel( 'Identificación : ' );
		$element->setRequired ( true );
		$element->addFilter ( 'StripTags' );
		$element->addFilter ( 'StringTrim' );
		$element->addValidator ( 'digits' );
		$array_elements[]=$element;
		
		$element = new Zend_Form_Element_Select('tipoidentificacion');
		$element->setRegisterInArrayValidator(false);
		$element->setMultiOptions($domConfig->DOM_TIPODOCUMENTO->toArray());
        $element->setRequired(true);
        $array_elements[]=$element;
        
		$element = new Zend_Form_Element_Select('codnivel');
		$element->setLabel( 'Nivel académico : ' );
		$element->setRegisterInArrayValidator(false);
		$element->setMultiOptions($this->NivelesAcademicos);
	    $element->setRequired(true);
	    $array_elements["codnivel"]=$element;
        
	    $element = new Zend_Form_Element_Select('codclasificacionarea');
		$element->setLabel( 'Area del conocimiento : ' );
		$element->setRegisterInArrayValidator(false);
		$element->setMultiOptions($this->AreasConocimiento);
	    $element->setRequired(true);
	    $array_elements["codclasificacionarea"]=$element;
		
        $element = new Zend_Form_Element_Text ( 'institucion' );
		$element->setLabel ( 'Institución o entidad : ' );
		$element->setRequired ( true );
		$element->addFilter ( 'StripTags' );
		$element->addFilter ( 'StringTrim' );
		$element->setAttribs(array('size'=>90));
		$array_elements["institucion"]=$element;
	        
		
		$element = new Zend_Form_Element_Text ( 'tituloformacion' );
		$element->setLabel( 'Título obtenido : ' );
		$element->setRequired ( true );
		$element->addFilter ( 'StripTags' );
		$element->addFilter ( 'StringTrim' );
		$element->setAttribs(array('size'=>50));
		$array_elements["tituloformacion"]=$element;
        
		$element = new Zend_Form_Element_Select('tipodedicacion');
		$element->setLabel( 'Dedicación : ' );
		$element->setRegisterInArrayValidator(false);
		$element->setMultiOptions($domConfig->TIPO_DEDICACION->toArray());
        $element->setRequired(true);
        $array_elements[]=$element;
        
		$element = new Zend_Form_Element_Select('modalidadformacion');
		$element->setLabel( 'Modalidad del programa : ' );
		$element->setRegisterInArrayValidator(false);
		$element->setMultiOptions($domConfig->MODALIDAD_FORMACION->toArray());
        $element->setRequired(true);
        $array_elements[]=$element;
        	       	    
        $element = new Zend_Form_Element_Text("horas");
        $element->setLabel("Número de horas : ");
        $element->setRequired(true);
        $element->addFilter('StripTags');
        $element->addFilter('StringTrim');
        $element->addValidator('digits');
        $element->setAttrib("size", 7);
        $array_elements[] = $element;
        	       	    
        $element = new Zend_Form_Element_Text("horasdocencia");
        $element->setLabel("Horas dedicación docencia: ");
        $element->setRequired(true);
        $element->addFilter('StripTags');
        $element->addFilter('StringTrim');
        $element->addValidator('digits');
        $element->setAttrib("size", 7);
        $array_elements[] = $element;
        
        $element = new Zend_Form_Element_Text("horasinvestigacion");
        $element->setLabel("Horas dedicación investigación: ");
        $element->setRequired(true);
        $element->addFilter('StripTags');
        $element->addFilter('StringTrim');
        $element->addValidator('digits');
        $element->setAttrib("size", 7);
        $array_elements[] = $element;
        
        $element = new Zend_Form_Element_Text("horasextension");
        $element->setLabel("Horas dedicación extensión: ");
        $element->setRequired(true);
        $element->addFilter('StripTags');
        $element->addFilter('StringTrim');
        $element->addValidator('digits');
        $element->setAttrib("size", 7);
        $array_elements[] = $element;
        
		$element = new Zend_Form_Element_Select('tipocontrato');
		$element->setLabel( 'Forma de contratación : ' );
		$element->setRegisterInArrayValidator(false);
		$element->setMultiOptions($domConfig->TIPO_CONTRATO->toArray());
        $element->setRequired(true);
        $array_elements[]=$element;
        
		$element = new Zend_Form_Element_Select('tipoestadia');
		$element->setLabel( 'Tiempo : ' );
		$element->setRegisterInArrayValidator(false);
		$element->setMultiOptions(array(5=>"AÑOS",4=>"MESES"));
        $element->setRequired(true);
        $array_elements[]=$element;
        
		$element = new Zend_Form_Element_Text ( 'estadia' );
		$element->setLabel( 'Cantidad de años / meses : ' );
		$element->setRequired ( true );
		$element->addFilter ( 'StripTags' );
		$element->addFilter ( 'StringTrim' );
		$element->addValidator ( 'digits' );
		$array_elements[]=$element;
		
        $element = new Zend_Form_Element_Textarea('actividades');
		$element->setLabel('Responsabilidad en el programa :');
		$element->setRequired(true);
		$element->addFilter('StripTags');
		$element->addFilter('StringTrim');
		$element->setAttrib("rows",5);
		$element->setAttrib("style","width:99%");
		$element->setRequired(true);
		$array_elements[] = $element;
               
        $submit = new Zend_Form_Element_Submit('btnSubmit');
        $submit->setValue('Guardar');
        $submit->setLabel("Guardar");
        $submit->setAttrib("class", "iceCmdBtn");
        $array_elements[] = $submit;
       
        $this->addElements($array_elements);
        $this->loadViewScriptDecorators();
//        $this->loadTableDecorators();
    
    }

    public function loadViewScriptDecorators() {
        $this->setDecorators(array(array('viewScript',array('viewScript'=>'viewscripts/docentesautoevaluacion_form.phtml'))));
    }
}